package com.tesis_2.Utils;

import java.lang.reflect.Modifier;
import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.example.t2_clientback.R;
import com.tesis_2.MO.MOLocal;
import com.tesis_2.MO.MOPlato;

public class UTPlatosMasConsumidos extends ArrayAdapter<MOPlato> {
	
	private final Context context;
	private final ArrayList<MOPlato> values;
	
	public UTPlatosMasConsumidos(Context context, ArrayList<MOPlato> objects) {
		super(context, R.layout.activity_uiplatos_mas_consumidos, objects);
		this.context = context;
		this.values = objects;
		// TODO Auto-generated constructor stub
	}
	
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = (LayoutInflater) context
			.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
		View rowView = inflater.inflate(R.layout.activity_uiplatos_mas_consumidos, parent, false);
		((TextView) rowView.findViewById(R.id.txvPlato_aceptar_platos_mas_consumidos)).setText( ((MOPlato) getItem(position)).getName());
		((TextView) rowView.findViewById(R.id.txvCantidad_aceptar_platos_mas_consumidos)).setText( ((MOPlato) getItem(position)).getRate().toString());
		return rowView;
	}

}
